package com.bm.server.controller;


import com.bm.server.bo.ChatBo;
import com.bm.server.serves.WebSocketMore;
import com.bm.server.util.Rutils;
import com.bm.server.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Description:
 * @Author: 赵金帅
 * @Date: 2022/07/21/11:23
 */
@RestController
@RequestMapping("/api/send")
@Api(tags = "谁是卧底聊天房实现发消息-赵金帅 ")
@CrossOrigin
public class SendMsgController {
    @PostMapping("onemsg.do")
    public R sendOne(@RequestBody ChatBo bo){
        WebSocketMore.sendSingleMsg(bo.getUid(), bo.getMsg());
        return Rutils.ok();
    }
    @PostMapping("moremsg.do")
    public R sendmore(@RequestParam String msg){
        WebSocketMore.sendMoreMsg(msg);
        return Rutils.ok();
    }
}
